package com.eleadmin.damon.utils.results;

import java.util.List;

/**
 * 分页结果对象,这里以layui框架的table为标准
 * Created by wangfan on 2017-6-10 上午10:10
 */
public class PageResult2<T> {

    private int code; // 状态码, 0表示成功

    private String message;  // 提示信息

    private DataResult data;

    private int page;//第一页

    private int limit;//每页10条


    public PageResult2() {
    }

    public PageResult2(List<T> rows) {
        this(rows, rows.size());
    }

    public PageResult2(List<T> rows, long total) {
        data= new DataResult();
        data.setList(rows);
        data.setCount(total);
        this.code = 0;
        this.message = "";
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getLimit() {
        return limit;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public DataResult getData() {
        return data;
    }

    public void setData(DataResult data) {
        this.data = data;
    }
}
